
#ifndef STMT_H
#define STMT_H

#include "decl.h"
#include <stdio.h>

struct stmt {
	int kind;
	struct decl *decl;
	struct expr *expr;
	struct stmt *body;
	struct stmt *ebody;
	struct stmt *next;
};

#define STMT_KIND_DECL    0
#define STMT_KIND_EXPR    1
#define STMT_KIND_IF_ELSE 2
#define STMT_KIND_WHILE   3
#define STMT_KIND_RETURN  4
#define STMT_KIND_BLOCK   5
#define STMT_KIND_PRINT   6

struct stmt * stmt_create ( 
  int kind, 
  struct decl * decl, 
  struct expr * expr, 
  struct stmt * body, 
  struct stmt * ebody, 
  struct stmt * next );


void stmt_print( struct stmt * stmt    ); //INC



void stmt_resolve( struct stmt *s, int print);
void stmt_typecheck( struct stmt *s, struct type * return_type );
void stmt_generate( FILE *f, struct stmt *s );

#endif
